/* 
 * File:   MatrixThread.cpp
 * Author: wgranger
 * 
 * Created on October 30, 2010, 11:51 PM
 */

#include "matrixthread.h"

MatrixThread::MatrixThread(int r,int i,int nR,Matrix *x,Matrix *y,
        Matrix *z) {
    row_start = r;
    inc = i;
    numRow = nR;
    A = x;
    B = y;
    C = z;
}

MatrixThread::~MatrixThread() {
}

void MatrixThread::run() {
    for (int r = row_start; r < numRow; r += inc) {
        for (int c = 0; c < numRow; c++) {
            C -> elements[r][c] = 0;
            for (int k = 0; k < numRow; k++) {
                C -> elements[r][c] +=
                        (A -> elements[r][k]) * (B -> elements[k][c]);
            }
        }
    }
}

